<template>
  <Layout>
    <Form ref="form1" :model="queryParam" :label-width="120">
      <Row :gutter="16" class="query-form2" v-show="!switchFlag">
        <Col span="8">
          <FormItem label="项目名称：" prop="projectName">
            <Input readonly class="query-form-el" type="text" v-model="queryParam.projectName"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="责任单位：">
            <Input readonly class="query-form-el" type="text" v-model="queryParam.dutyOrgName"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <div style="float: right;">
            <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
            <Button class="ivu-btn-reset" style="margin-left: 10px" @click="cancel">重置</Button>
            <Button @click="switchQuery(true)" style="margin-left: 10px" class="ivu-btn-switch2" type="text">展开
              <Icon type="ios-arrow-down"/>
            </Button>
          </div>
        </Col>
      </Row>
      <Row v-show="switchFlag" class="query-form">
        <Col span="8">
          <FormItem label="项目名称：" prop="projectName">
            <Input readonly class="query-form-el" type="text" v-model="queryParam.projectName"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="责任单位：" prop="dutyOrgName">
            <Input readonly class="query-form-el" type="text" v-model="queryParam.dutyOrgName"></Input>
          </FormItem>
        </Col>
        <Col span="8">
          <FormItem label="项目性质：">
            <Select v-model="queryParam.projectNature">
              <Option v-for="item in projectNatureMaps" :value="item.codingCodeId" :key="item.codingCodeId">
                {{ item.codingName }}
              </Option>
            </Select>
          </FormItem>
        </Col>
      </Row>
      <Row v-show="switchFlag" class="query-form">
        <Col span="8">
          <FormItem label="项目级别：">
            <Select v-model="queryParam.projectLevel">
              <Option v-for="item in projectLevelMaps" :value="item.codingCodeId" :key="item.codingCodeId">
                {{ item.codingName }}
              </Option>
            </Select>
          </FormItem>
        </Col>
        <Col span="8">
        </Col>
        <Col span="8">
          <Button @click="switchQuery(false)" class="ivu-btn-switch" type="text">收起∧</Button>
          <Button @click="reset" class="ivu-btn-reset">重置</Button>
          <Button class="ivu-btn-query" icon="md-search" @click="query">查询</Button>
        </Col>
      </Row>
    </Form>

    <Table ref='table' highlight-row :height="tableHeight" :loading="loading"
           border :columns="columns1" :data="dataTable">
    </Table>

    <Row style="margin-right:10px;">
      <Col span="24">
        <Page style="float: right" :total="pagedata.total" :page-size="pagedata.pageSize"
              @on-change="pageChange" @on-page-size-change="pageSizeChange" :page-size-opts="pageSizeArray"
              show-total show-sizer show-elevator/>
      </Col>
    </Row>

    <Modal :transfer=false v-model="threeSimAccountVisible" :width=1200 class="modal-view-detail"
           footer-hide @on-cancel="onCancel" class-name='limit-height-dialog'>
      <Tabs v-model="tabName">
        <TabPane label="项目基本信息" name="name1" style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Form :model="showdata" :label-width="150">
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="23">
                    <FormItem label="项目名称：" prop="projectName">
                      {{ showdata.projectName }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="23">
                    <FormItem label="项目基本情况：" prop="projectDesc">
                      {{showdata.projectDesc}}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="责任单位：" prop="dutyOrgId">
                      {{ showdata.dutyOrgName }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="项目设计单位：" prop="designUnit">
                      {{ showdata.designUnit }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="项目性质：" prop="projectNature">
                      {{ showdata.projectNatureName }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="项目级别：" prop="projectLevel">
                      {{ showdata.projectLevelName }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="所在行政区域：" prop="administrativeMap">
                      {{ areaCodeToAreaName(showdata.administrativeMap) }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="立项时间：" prop="establishmentTime">
                      {{ showdata.establishmentTimeStr }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="计划开工时间：" prop="startTime">
                      {{ showdata.startTimeStr }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="计划完工时间：" prop="endTime">
                      {{ showdata.endTimeStr }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="总投资（万元）：" prop="totalInvestment">
                      {{ showdata.totalInvestment }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="年综合能源消耗量（吨标准煤）：" prop="powerConsumption">
                      {{ showdata.powerConsumption }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="11">
                    <FormItem label="项目负责人：" prop="projectLeader">
                      {{ showdata.projectLeader }}
                    </FormItem>
                  </Col>
                  <Col span="11">
                    <FormItem label="联系电话：" prop="contactPhone">
                      {{ showdata.contactPhone }}
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="23">
                    <FormItem label="三同时类型：" prop="projectType">
                      <CheckboxGroup v-model="showdata.projectType">
                        <Checkbox label="1" disabled>环保水保三同时</Checkbox>
                        <Checkbox label="2" disabled>职业卫生三同时</Checkbox>
                        <Checkbox label="3" disabled>安全三同时</Checkbox>
                        <Checkbox label="4" disabled>节能评估三同时</Checkbox>
                        <Checkbox label="5" disabled>消防三同时</Checkbox>
                      </CheckboxGroup>
                    </FormItem>
                  </Col>
                </Row>
                <Row type="flex" justify="space-around" class="code-row-bg">
                  <Col span="23">
                    <FormItem label="备注：" prop="remark">
                      {{ showdata.remark }}
                    </FormItem>
                  </Col>
                </Row>
              </Form>
            </Col>
          </Row>
        </TabPane>
        <TabPane label="环保水保三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnvironmental=='1'"
                 name="name2" style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Card>
                <p slot="title">可研设计资料</p>
                <Form ref="threeSimEnvironmentalDatas" :model="threeSimEnvironmentalDatas" :rules="ruleCustom"
                      label-position="left">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4">
                    </Col>
                    <Col span="4">
                      编制单位
                    </Col>
                    <Col span="4">
                      批复时间
                    </Col>
                    <Col span="4">
                      批复/备案文号
                    </Col>
                    <Col span="4">
                      初审部门
                    </Col>
                    <Col span="4">
                      审批部门
                    </Col>
                  </Row>
                  <br>
                  <div v-for="item in threeSimEnvironmentalDatas">
                    <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                      <Col span="4">
                        <label style="float:right">{{ item.environmentTypeName }}</label>
                      </Col>
                      <Col span="4">
                        <Input readonly v-model="item.organizationUnit" type="text"/>
                      </Col>
                      <Col span="4">
                        <DatePicker type="date" placeholder="选择时间" v-model="item.replyTime"/>
                      </Col>
                      <Col span="4">
                        <Input readonly v-model="item.recordIcp" type="text"/>
                      </Col>
                      <Col span="4">
                        <Input readonly v-model="item.intitalInvestigationDepartment" type="text"/>
                      </Col>
                      <Col span="4">
                        <Input readonly v-model="item.investigationDepartment" type="text"/>
                      </Col>
                      <br>
                    </Row>
                    <br>
                  </div>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4" style="float:right">
                      <label style="float:right">可研报告：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalDesignFile.fileName">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalDesignFile.fileId,environmentalDesignFile.fileName,environmentalDesignFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4" style="float:right">
                      <label style="float:right">环境影响评价报告：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalInfluenceReportFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalInfluenceReportFile.fileId,environmentalInfluenceReportFile.fileName,environmentalInfluenceReportFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4" style="float:right">
                      <label style="float:right">环境影响评价批复：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalInfluenceReplyFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalInfluenceReplyFile.fileId,environmentalInfluenceReplyFile.fileName,environmentalInfluenceReplyFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4" style="float:right">
                      <label style="float:right">水土保持评价报告：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalSoilWaterReportFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalSoilWaterReportFile.fileId,environmentalSoilWaterReportFile.fileName,environmentalSoilWaterReportFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4" style="float:right">
                      <label style="float:right">水土保持评价批复：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalSoilWaterReplyFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalSoilWaterReplyFile.fileId,environmentalSoilWaterReplyFile.fileName,environmentalSoilWaterReplyFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4">
                      <label style="float:right">水土保持补偿费缴纳凭证：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalSoilWaterPayProofFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalSoilWaterPayProofFile.fileId,environmentalSoilWaterPayProofFile.fileName,environmentalSoilWaterPayProofFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4">
                      <label style="float:right">水土保持地方政府批复：</label>
                    </Col>
                    <Col span="17">
                      <Input readonly type="text" v-model="environmentalSoilWaterGovermentReplyFile.name">
                        <Button type="ghost" slot="append"
                                @click="downloadFile(environmentalSoilWaterGovermentReplyFile.fileId,environmentalSoilWaterGovermentReplyFile.fileName,environmentalSoilWaterGovermentReplyFile)">
                          下载
                        </Button>
                      </Input>
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="4">
                      <label style="float:right">备注：</label>
                    </Col>
                    <Col span="19">
                      <Input readonly v-model="threeSimEnvironmentalDatas[0].remark" type="textarea"/>
                    </Col>
                    <Col span="1"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">过程管理</p>
                <Form ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="环保水保过程文件">
                        <div v-show="environmentalProcessFiles.length>0"
                             v-for="(item,index) in environmentalProcessFiles" :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">竣工验收材料</p>
                <Form ref="threeSimEnvironmentalCompleteData" :model="threeSimEnvironmentalCompleteData"
                      :rules="ruleCustom" label-position="left">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">试生产阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="环保监理单位">
                        <Input readonly type="text" v-model="threeSimEnvironmentalCompleteData.environManageUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="环保检测单位">
                        <Input readonly type="text" v-model="threeSimEnvironmentalCompleteData.environDetectionUnit"/>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="环保监理报告">
                        <Input readonly type="text" v-model="environManageReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environManageReportFile.fileId,environManageReportFile.fileName,environManageReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="环保检测数据文件">
                        <Input readonly type="text" v-model="environDetectionFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environDetectionFile.fileId,environDetectionFile.fileName,environDetectionFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="水土保持监理单位">
                        <Input readonly type="text" v-model="threeSimEnvironmentalCompleteData.waterSoilManageUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="水土保持检测单位">
                        <Input readonly type="text" v-model="threeSimEnvironmentalCompleteData.waterSoilDetectionUnit"/>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="水土保持补偿费（元）">
                        <InputNumber :min="0" readonly v-model="threeSimEnvironmentalCompleteData.waterSoilCompensati"
                                     style="width: 100%;"></InputNumber>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="水土保持监理报告">
                        <Input readonly type="text" v-model="environWaterSoilManageFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environWaterSoilManageFile.fileId,environWaterSoilManageFile.fileName,environWaterSoilManageFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="水土保持监测数据文件">
                        <Input readonly type="text" v-model="environWaterSoilDetectionFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environWaterSoilDetectionFile.fileId,environmentalInfluenceReportFile.fileName,environmentalInfluenceReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">竣工验收阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="环保竣工验收报告">
                        <Input readonly type="text" v-model="environReceiveFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environReceiveFile.fileId,environReceiveFile.fileName,environReceiveFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="环保竣工验收备案表">
                        <Input readonly type="text" v-model="environReceiveRecordFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environReceiveRecordFile.fileId,environReceiveRecordFile.fileName,environReceiveRecordFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="水土保持验收报告">
                        <Input readonly type="text" v-model="environWaterSoilReceiveFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environWaterSoilReceiveFile.fileId,environWaterSoilReceiveFile.fileName,environWaterSoilReceiveFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="水土保持地方验收批复">
                        <Input readonly type="text" v-model="environWaterSoilReceiveReplyFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(environWaterSoilReceiveReplyFile.fileId,environWaterSoilReceiveReplyFile.fileName,environWaterSoilReceiveReplyFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                </Form>
              </Card>
            </Col>
          </Row>
        </TabPane>
        <TabPane label="职业卫生三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isHealth=='1'" name="name3"
                 style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Card>
                <p slot="title">可研设计资料</p>
                <Form ref="threeSimHealthData" :model="threeSimHealthData" :rules="ruleCustom" label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="评价单位">
                        <Input readonly type="text" v-model="threeSimHealthData.evaluateUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="主要职业病危害因素">
                        <Input readonly type="text" v-model="threeSimHealthData.hazardFactors"/>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="职业病危险因素影响程度">
                        <Input readonly type="text" v-model="threeSimHealthData.influenceLevel"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="职业病防护专项投资预算（万元）">
                        <Input readonly type="text" v-model="threeSimHealthData.investmentBudget"/>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">可研阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="预评价报告">
                        <Input readonly type="text" v-model="healthEvaluateReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthEvaluateReportFile.fileId,healthEvaluateReportFile.fileName,healthEvaluateReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="评价方案">
                        <Input readonly type="text" v-model="healthPreEvaluateProjectFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthPreEvaluateProjectFile.fileId,healthPreEvaluateProjectFile.fileName,healthPreEvaluateProjectFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="建设单位意见">
                        <Input readonly type="text" v-model="healthBuildUnitFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthBuildUnitFile.fileId,healthBuildUnitFile.fileName,healthBuildUnitFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="专家组验收意见">
                        <Input readonly type="text" v-model="healthZJAcceptAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthZJAcceptAdviceFile.fileId,healthZJAcceptAdviceFile.fileName,healthZJAcceptAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="报告修改确认材料">
                        <Input readonly type="text" v-model="healthModifySureFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthModifySureFile.fileId,healthModifySureFile.fileName,healthModifySureFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">设计阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="防护设施设计文件">
                        <Input readonly type="text" v-model="healthProtectDesignFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthProtectDesignFile.fileId,healthProtectDesignFile.fileName,healthProtectDesignFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="评价方案">
                        <Input readonly type="text" v-model="healthEvaluateProjectFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthEvaluateProjectFile.fileId,healthEvaluateProjectFile.fileName,healthEvaluateProjectFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="建设单位意见">
                        <Input readonly type="text" v-model="healthBuildUnitAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthBuildUnitAdviceFile.fileId,healthBuildUnitAdviceFile.fileName,healthBuildUnitAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="专家组意见">
                        <Input readonly type="text" v-model="healthZJAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthZJAdviceFile.fileId,healthZJAdviceFile.fileName,healthZJAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="报告修改确认材料">
                        <Input readonly type="text" v-model="healthReportModifyFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthReportModifyFile.fileId,healthReportModifyFile.fileName,healthReportModifyFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">过程管理</p>
                <Form ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="职业卫生过程文件">
                        <div v-show="healthProcessFiles.length>0" v-for="(item,index) in healthProcessFiles"
                             :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">竣工验收材料</p>
                <Form ref="threeSimHealthCompleteData" :model="threeSimHealthCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="验收方案">
                        <Input readonly type="text" v-model="healthReceiveReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthReceiveReportFile.fileId,healthReceiveReportFile.fileName,healthReceiveReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="验收工作报告">
                        <Input readonly type="text" v-model="healthReceiveWorkFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthReceiveWorkFile.fileId,healthReceiveWorkFile.fileName,healthReceiveWorkFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="控评报告">
                        <Input readonly type="text" v-model="healthControlEvaluateFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthControlEvaluateFile.fileId,healthControlEvaluateFile.fileName,healthControlEvaluateFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="建设单位意见">
                        <Input readonly type="text" v-model="healthBuildUnitAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthBuildUnitAdviceFile.fileId,healthBuildUnitAdviceFile.fileName,healthBuildUnitAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="专家组意见">
                        <Input readonly type="text" v-model="healthZJGroupFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthZJGroupFile.fileId,healthZJGroupFile.fileName,healthZJGroupFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="报告修改及现场整改验收报告">
                        <Input readonly type="text" v-model="healthReportModifyAndReceiveFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthReportModifyAndReceiveFile.fileId,healthReportModifyAndReceiveFile.fileName,healthReportModifyAndReceiveFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="向业务处室报备材料">
                        <Input readonly type="text" v-model="healthMaterialFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(healthMaterialFile.fileId,healthMaterialFile.fileName,healthMaterialFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                </Form>
              </Card>
            </Col>
          </Row>
        </TabPane>
        <TabPane label="安全三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isSafe=='1'" name="name4"
                 style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Card>
                <p slot="title">可研设计资料</p>
                <Form ref="threeSimSafeData" :model="threeSimSafeData" :rules="ruleCustom" label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">可研阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="预评价报告编制单位：">
                        <Input readonly type="text" v-model="threeSimSafeData.quotaUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="预评价报告审查完成时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeData.safeExamineFinishTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="预评价报告">
                        <Input readonly type="text" v-model="safePreEvaluateReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safePreEvaluateReportFile.fileId,safePreEvaluateReportFile.fileName,safePreEvaluateReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="预评价报告审查意见">
                        <Input readonly type="text" v-model="safePreEvaluateAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safePreEvaluateAdviceFile.fileId,safePreEvaluateAdviceFile.fileName,safePreEvaluateAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <label style="font-weight:900;font-size:16px">设计阶段资料</label>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                  <br>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全设施设计单位">
                        <Input readonly type="text" v-model="threeSimSafeData.designUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全设施设计批复时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeData.replyTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全设施设计报告">
                        <Input readonly type="text" v-model="safeDesignReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeDesignReportFile.fileId,safeDesignReportFile.fileName,safeDesignReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全设施设计批复文件">
                        <Input readonly type="text" v-model="safeDesignReplyFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeDesignReplyFile.fileId,safeDesignReplyFile.fileName,safeDesignReplyFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">过程管理</p>
                <Form ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全过程文件">
                        <div v-show="safeProcessFiles.length>0" v-for="(item,index) in safeProcessFiles" :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">竣工验收材料</p>
                <Form ref="threeSimSafeCompleteData" :model="threeSimSafeCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全验收评价单位">
                        <Input readonly type="text" v-model="threeSimSafeCompleteData.evaluateUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全验收评价时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeCompleteData.evaluateTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全验收评价报告">
                        <Input readonly type="text" v-model="safeReceiveEvaluateReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeReceiveEvaluateReportFile.fileId,safeReceiveEvaluateReportFile.fileName,safeReceiveEvaluateReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全验收评价报告审查意见">
                        <Input readonly type="text" v-model="safeReceiveEvaluateAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeReceiveEvaluateAdviceFile.fileId,safeReceiveEvaluateAdviceFile.fileName,safeReceiveEvaluateAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全设施竣工验收意见">
                        <Input readonly type="text" v-model="safeFacilityReceiveAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeFacilityReceiveAdviceFile.fileId,safeFacilityReceiveAdviceFile.fileName,safeFacilityReceiveAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全设施竣工验收批复">
                        <Input readonly type="text" v-model="safeFacilityReplyFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(safeFacilityReplyFile.fileId,safeFacilityReplyFile.fileName,safeFacilityReplyFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="安全验收评价报告审查完成时间">
                        <DatePicker type="date" placeholder="选择时间"
                                    v-model="threeSimSafeCompleteData.reportExamineFinishTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="安全设施竣工验收完成时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeCompleteData.checkFinishTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                  </Row>
                </Form>
              </Card>
            </Col>
          </Row>
        </TabPane>
        <TabPane label="节能评估三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isEnergy=='1'" name="name5"
                 style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Card>
                <p slot="title">可研设计资料</p>
                <Form ref="threeSimSafeCompleteData" :model="threeSimSafeCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="节能报告编制单位">
                        <Input readonly type="text" v-model="threeSimEnergyData.quotaUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="股份公司内部审查时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimEnergyData.examineFinishTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="股份公司内部审查节能报告">
                        <Input readonly type="text" v-model="energyReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyReportFile.fileId,energyReportFile.fileName,energyReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="股份公司内部审查纪要">
                        <Input readonly type="text" v-model="energySummaryFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energySummaryFile.fileId,energySummaryFile.fileName,energySummaryFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="政府审查机构">
                        <Input readonly type="text" v-model="threeSimEnergyData.examineUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="地方政府审查节能报告">
                        <Input readonly type="text" v-model="energyLocalGovermentReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyLocalGovermentReportFile.fileId,energyLocalGovermentReportFile.fileName,energyLocalGovermentReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="优化措施实现节能量（吨标准煤）">
                        <Input readonly type="text" v-model="threeSimEnergyData.economyEnergy"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="优化措施实现节约投资（万元）">
                        <Input readonly type="text" v-model="threeSimEnergyData.economyInvestment"/>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="政府审查时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimEnergyData.governmentExamineTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="地方政府审查批复文件">
                        <Input readonly type="text" v-model="energyLocalGovermentReplyFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyLocalGovermentReplyFile.fileId,energyLocalGovermentReplyFile.fileName,energyLocalGovermentReplyFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="优化措施实现节水量（万立方米）">
                        <Input readonly type="text" v-model="threeSimEnergyData.economyWater"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="项目评估优化措施明细">
                        <Input readonly type="text" v-model="energyControlDetailFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyControlDetailFile.fileId,energyControlDetailFile.fileName,energyControlDetailFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">过程管理</p>
                <Form ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="节能评估过程文件">
                        <div v-show="energyProcessFiles.length>0" v-for="(item,index) in energyProcessFiles"
                             :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">竣工验收材料</p>
                <Form ref="threeSimEnergyCompleteData" :model="threeSimEnergyCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="节能验收报告编制单位">
                        <Input readonly type="text" v-model="threeSimEnergyCompleteData.receiveReportQuotaUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="节能验收报告">
                        <Input readonly type="text" v-model="energyReceiveReportFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyReceiveReportFile.fileId,energyReceiveReportFile.fileName,energyReceiveReportFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="政府验收机构">
                        <Input readonly type="text" v-model="threeSimEnergyCompleteData.govermentReceiveUnit"/>
                      </FormItem>
                    </Col>
                    <Col span="11">
                      <FormItem label="地方政府验收意见">
                        <Input readonly type="text" v-model="energyLocalGovermentReceiveAdviceFile.name">
                          <Button type="ghost" slot="append"
                                  @click="downloadFile(energyLocalGovermentReceiveAdviceFile.fileId,energyLocalGovermentReceiveAdviceFile.fileName,energyLocalGovermentReceiveAdviceFile)">
                            下载
                          </Button>
                        </Input>
                      </FormItem>
                    </Col>
                  </Row>
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="验收时间">
                        <DatePicker type="date" placeholder="选择时间" v-model="threeSimSafeCompleteData.receiveTime"
                                    style="width: 100%"></DatePicker>
                      </FormItem>
                    </Col>
                    <Col span="11">
                    </Col>
                  </Row>
                </Form>
              </Card>
            </Col>
          </Row>
        </TabPane>
        <TabPane label="消防三同时" v-if="Object.keys(selectedInfo).length==0||selectedInfo.isFire=='1'" name="name6"
                 style="height:500px;overflow-x:hidden;overflow-y:auto;">
          <Row>
            <Col span="24">
              <Card>
                <p slot="title">可研设计资料</p>
                <Form ref="threeSimEnergyCompleteData" :model="threeSimEnergyCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="消防报告">
                        <div v-show="fireReportFiles.length>0" v-for="(item,index) in fireReportFiles" :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">过程管理</p>
                <Form ref="threeSimEnergyProcessData" :model="threeSimEnergyProcessData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="消防过程文件">
                        <div v-show="fireProcessFiles.length>0" v-for="(item,index) in fireProcessFiles" :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
              <Card>
                <p slot="title">竣工验收材料</p>
                <Form ref="threeSimEnergyCompleteData" :model="threeSimEnergyCompleteData" :rules="ruleCustom"
                      label-position="top">
                  <Row :gutter="16" type="flex" justify="space-around" class="code-row-bg">
                    <Col span="11">
                      <FormItem label="消防报告">
                        <div v-show="fireCompleteReportFiles.length>0" v-for="(item,index) in fireCompleteReportFiles"
                             :key='item'>
                          <a @click="downloadFile(item.fileId,item.fileName,item)">{{ item.fileName }}</a>
                        </div>
                      </FormItem>
                    </Col>
                    <Col span="11"></Col>
                  </Row>
                </Form>
              </Card>
            </Col>
          </Row>
        </TabPane>
      </Tabs>
    </Modal>
    <Modal title="项目状态更改" :transfer=false v-model="model2" :width=500>
      <Form ref="form1datacopy" :model="form1datacopy" label-position="top" :rules="fulesData">
        <Row type="flex" justify="space-around" class="code-row-bg">
          <Col span="23">
            <FormItem label="项目状态：">
              <Select v-model="form1datacopy.condition" style="width:100%">
                <Option  value="2" >在建</Option>
                <Option  value="1" >竣工</Option>
              </Select>
            </FormItem>
          </Col>
        </Row>
      </Form>
      <div slot="footer">
        <Button @click="submitCondition('form1datacopy')" class="ivu-btn-save" :loading="buttonLoading">确定</Button>
        <Button class='ivu-btn-cancel' @click="model2=false">取消</Button>
      </div>
    </Modal>
  </layout>
</template>

<script>
import {Api} from '../../../api/index.js'
import cascaderDom from '../../../components/cascader-dom'
import {mapState, mapGetters, mapActions} from 'vuex'
import {sessionStorage} from '../../../common/cacheUtils.js';
import pageCommonFunction from '@/components/pageCommonFunction.js'

export default {
  components: {
    cascaderDom
  },
  data() {
    return {
      form1datacopy: {},
      buttonLoading:false,
      tabName: "",
      queryParam: {projectName: "", dutyOrgName: '', projectLevel: '', projectNature: ''},
      threeSimAccountVisible: false,
      environmentalDesignFile: {},
      environmentalInfluenceReportFile: {},
      environmentalInfluenceReplyFile: {},
      environmentalSoilWaterReportFile: {},
      environmentalSoilWaterPayProofFile: {},
      environmentalSoilWaterGovermentReplyFile: {},
      environmentalSoilWaterReplyFile: {},
      healthBuildUnitFile: {},
      healthEvaluateProjectFile: {},
      healthPreEvaluateProjectFile: {},
      healthEvaluateReportFile: {},
      healthModifySureFile: {},
      healthProtectDesignFile: {},
      healthReportModifyFile: {},
      healthZJAdviceFile: {},
      healthZJAcceptAdviceFile: {},
      safeDesignReplyFile: {},
      safeDesignReportFile: {},
      safePreEvaluateAdviceFile: {},
      safePreEvaluateReportFile: {},
      energyControlDetailFile: {},
      energyLocalGovermentReplyFile: {},
      energyLocalGovermentReportFile: {},
      energyReportFile: {},
      energySummaryFile: {},
      environmentalVisible: false,
      healthVisible: false,
      safeVisible: false,
      energyVisible: false,
      threeSimEnvironmentalDatas: [{}],
      threeSimHealthData: {},
      threeSimEnergyData: {},
      threeSimSafeData: {},
      environReceiveFile: {},
      environWaterSoilDetectionFile: {},
      environReceiveRecordFile: {},
      environWaterSoilManageFile: {},
      environWaterSoilReceiveFile: {},
      environWaterSoilReceiveReplyFile: {},
      environDetectionFile: {},
      environManageReportFile: {},
      safeFacilityReceiveAdviceFile: {},
      safeFacilityReplyFile: {},
      safeReceiveEvaluateAdviceFile: {},
      safeReceiveEvaluateReportFile: {},
      healthBuildUnitAdviceFile: {},
      healthControlEvaluateFile: {},
      healthMaterialFile: {},
      healthReceiveReportFile: {},
      healthReceiveWorkFile: {},
      healthReportModifyAndReceiveFile: {},
      healthZJGroupFile: {},
      energyLocalGovermentReceiveAdviceFile: {},
      energyReceiveReportFile: {},
      threeSimEnvironmentalCompleteData: {},
      threeSimHealthCompleteData: {},
      threeSimEnergyCompleteData: {},
      threeSimSafeCompleteData: {},
      fireReportFiles: [],
      fireCompleteReportFiles: [],
      environmentalProcessFiles: [],
      healthProcessFiles: [],
      safeProcessFiles: [],
      energyProcessFiles: [],
      form1: {},
      isUpdate: false,
      switchFlag: false,
      projectLevelMaps: {},
      projectNatureMaps: {},
      projectNatures: [],
      projectLevels: [],
      pageSizeArray: [10, 20, 50],
      pagedata: {
        total: 0,
        pageSize: 10,
        currentPage: 1,
      },
      columns1: [
        {
          title: "序号",
          width: 80,
          align: "center",
          fixed: 'left',
          render: (h, params) => {
            return h('span', params.index + (this.pagedata.currentPage - 1) * this.pagedata.pageSize + 1);
          }
        },
        {
          minWidth: 200,
          title: '项目状态',
          key: 'projectName',
          align: 'center',
          fixed: 'left',
          render: (h, params) => {
            return h('span', params.row.condition == '1' ? '竣工':'在建');
          }

        },
        {
          minWidth: 220,
          title: '项目名称',
          key: 'projectName',
          align: 'center'

        },
        {
          minWidth: 220,
          title: '责任单位',
          key: 'dutyOrgName',
          align: 'center'
        },
        {
          minWidth: 220,
          title: '项目设计单位',
          key: 'designUnit',
          align: 'center'
        },
        {
          minWidth: 220,
          title: '项目性质',
          key: 'projectNature',
          align: 'center',
          render: (h, params) => {
            return h('span', this.projectNatureMaps && this.projectNatureMaps[params.row.projectNature] && this.projectNatureMaps[params.row.projectNature].codingName)
          },
        },
        {
          minWidth: 220,
          title: '项目级别',
          key: 'projectLevel',
          align: 'center',
          render: (h, params) => {
            return h('span', this.projectLevelMaps && this.projectLevelMaps[params.row.projectLevel] && this.projectLevelMaps[params.row.projectLevel].codingName)
          },
        },
        {
          minWidth: 220,
          title: '所在行政区域',
          key: 'administrativeMap',
          align: 'center',
          render: (h, params) => {
            return h('span', this.areaCodeToAreaName(params.row.administrativeMap));
          },
        },
        {
          minWidth: 220,
          title: '总投资（万元）',
          key: 'totalInvestment',
          align: 'center'
        },
        {
          minWidth: 220,
          title: '年综合能源消耗量（吨标准煤）',
          key: 'powerConsumption',
          align: 'center'
        },
        {
          minWidth: 220,
          title: '立项时间',
          key: 'establishmentTime',
          align: 'center',
          render: (h, params) => {
            return h('span', this.formatDate(new Date(params.row.establishmentTime), "yyyy-MM-dd"));
          }
        },
        {
          minWidth: 130,
          title: '计划开工时间',
          key: 'startTime',
          align: 'center',
          render: (h, params) => {
            return h('span', this.formatDate(new Date(params.row.startTime), "yyyy-MM-dd"));
          }
        },
        {
          minWidth: 130,
          title: '计划完工时间',
          key: 'endTime',
          align: 'center',
          render: (h, params) => {
            return h('span', this.formatDate(new Date(params.row.endTime), "yyyy-MM-dd"));
          }
        },
        {
          minWidth: 130,
          title: '环境',
          key: 'checkCycle',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.isEnvironmental == '1' ? '√' : '×');
          }
        },
        {
          minWidth: 130,
          title: '职业卫生',
          key: 'health',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.isHealth == '1' ? '√' : '×');
          }
        },
        {
          minWidth: 130,
          title: '安全',
          key: 'safe',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.isSafe == '1' ? '√' : '×');
          }
        },
        {
          minWidth: 130,
          title: '节能评估',
          key: 'energySaving',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.isEnergy == '1' ? '√' : '×');
          }
        },
        {
          minWidth: 130,
          title: '消防',
          key: 'fireProtection',
          align: 'center',
          render: (h, params) => {
            return h('span', params.row.isFire == '1' ? '√' : '×');
          }
        },
        {
          minWidth: 130,
          title: '联系电话',
          key: 'contactPhone',
          align: 'center'
        },
        {
          title: '操作',
          key: 'action',
          fixed: 'right',
          minWidth: 170,
          align: 'center',
          render: (h, params) => {
            return h('div', [
              h('A', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  fontSize: '14px',
                },
                on: {
                  click: () => {
                    this.dataTable.forEach((items) => {      //先取消所有对象的勾选，checkBox设置为false
                      this.$set(items, 'checkBox', false)
                    });
                    this.dataTable[params.index].checkBox = true;  //再将勾选的对象的checkBox设置为true
                    this.viewInfo(params.row);
                  }
                }
              }, '详情'),
              h('Divider', {
                props: {
                  type: 'vertical',
                }
              }, ''),
              h('A', {
                props: {
                  type: 'primary',
                  size: 'small'
                },
                style: {
                  fontSize: '14px',

                },
                on: {
                  click: () => {
                    this.model2 = true;
                    this.form1datacopy =  JSON.parse(JSON.stringify(params.row));
                  }
                }
              }, '修改状态'),
            ]);
          }
        }
      ],
      fulesData:{
        condition: [{required: true, message: '  ', trigger: 'blur,change'}],
      },
      model2: false,
      ruleCustom: {
        planName: [{required: true, message: '  ', trigger: 'blur,change'}],
        planDate: [{required: true, message: '  ', trigger: 'blur,change', pattern: /.+/}],
        screenOrgId: [{required: true, message: '  ', trigger: 'blur'}],
        screenPositionId: [{required: true, message: '  ', trigger: 'blur'}]
      },
      selectedInfo: {},
      add: false,
      titleName: '',
      loading: false,
      tableHeight: '',
      dataTable: [],
      showdata: {},
      currentUser: sessionStorage('userId').getObject('userId'),
      currentUserId: sessionStorage('userId').getObject('userId').userId,
      rootOrgId: ''
    }
  },
  async mounted() {
    this.rootOrgId = sessionStorage('userId').getObject('userId').companyId;
    this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 145;
    await this.$store.dispatch('trhg/area/query', {scope: this}, {root: true});
    this.query();
    this.$http.get(Api.queryCodeDetailBySortId + '/STS-000001', {params: {}}).then((res) => {
      this.projectLevelMaps = this.dictListToMap(res.data.data);
      this.projectLevels = res.data.data;
    });
    this.$http.get(Api.queryCodeDetailBySortId + '/STS-000002', {params: {}}).then((res) => {
      this.projectNatureMaps = this.dictListToMap(res.data.data);
      this.projectNatures = res.data.data;
    });
  },
  computed: {
    ...mapState('trhg', {
      areaTree: state => state.area.areaTree ? state.area.areaTree : [],
      areaMap: state => state.area.areaMap ? state.area.areaMap : [],
    }),
  },
  methods: {
    ...pageCommonFunction,
    selectedChanged(row) {
      this.selectedInfo = row;
    },
    submitCondition(){
      this.$refs['form1datacopy'].validate((valid) => {
        if (valid) {
            this.$http.get(Api.threeSimProjectState+this.form1datacopy.projectId, {params:{state:this.form1datacopy.condition}}).then((res) => {
              this.$Message.success("保存成功")
              this.model2 = false;
              this.query();
            }).catch(e => {
              this.model2 = false;
              this.query();
              this.$Message.error("数据获取失败")
            })
        } else {

        }
      })
    },
    downloadFile(fileId, fileName, file) {
      if (fileId != undefined && fileId != 'undefined' && fileId != '') {
        let url = Api.singlePicture + "/" + fileId
        this.$http.get(url, {
          responseType: 'blob'      //告诉服务器我们需要的响应格式
        }).then((res) => {
          const aLink = document.createElement("a");
          let blob = new Blob([res.data], {
            type: res.body.type      //将会被放入到blob中的数组内容的MIME类型
          });
          aLink.href = URL.createObjectURL(blob)
          aLink.download = fileName //标题
          aLink.click()
          document.body.appendChild(aLink)
        })
      } else {
        let aTag = document.createElement('a');//创建一个a标签
        aTag.download = file.name;
        let href = URL.createObjectURL(file);//获取url
        aTag.href = href;
        aTag.click();
        URL.revokeObjectURL(href);//释放url
      }
    },
    query() {
      this.selectedInfo = {};
      this.loading = true;
      let user = sessionStorage('userId').getObject('userId');
      let data = {
        startPage: this.pagedata.currentPage,
        size: this.pagedata.pageSize,
        companyId: user.companyId
      }
      data = Object.assign(data, JSON.parse(JSON.stringify(this.queryParam)));
      this.$http.get(Api.threeSimProjectList, {
        params: data
      }).then(function (res) {
        if (res.data.status == 200) {
          this.dataTable = res.data.data.data;
          this.pagedata.total = res.data.data.totalSize;
        }
        this.loading = false;
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
    },
    submit(name, type) {
      this.$refs[name].validate((valid) => {
        if (valid) {
          if (type == 'environmental') {
            this.buttonLoading = true
            if (this.isUpdate) {
              let url = Api.threeSimEnvironmental;
              this.$http.put(url, this.threeSimEnvironmentalDatas).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.environmentalVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            } else {
              let url = Api.threeSimEnvironmental;
              this.$http.post(url, this.threeSimEnvironmentalDatas).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.environmentalVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            }
          }
          if (type == 'health') {
            this.buttonLoading = true
            if (this.isUpdate) {
              let url = Api.threeSimHealth
              this.$http.put(url, this.threeSimHealthData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.healthVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            } else {
              let url = Api.threeSimHealth;
              this.$http.post(url, this.threeSimHealthData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.healthVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            }
          }
          if (type == 'safe') {
            this.buttonLoading = true
            if (this.isUpdate) {
              let url = Api.threeSimSafe
              this.$http.put(url, this.threeSimSafeData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.safeVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            } else {
              let url = Api.threeSimSafe;
              this.$http.post(url, this.threeSimSafeData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.safeVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            }
          }
          if (type == 'energy') {
            this.buttonLoading = true
            if (this.isUpdate) {
              let url = Api.threeSimEnergy
              this.$http.put(url, this.threeSimEnergyData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.energyVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            } else {
              let url = Api.threeSimEnergy;
              this.$http.post(url, this.threeSimEnergyData).then((res) => {
                if (res.data.status == 200) {
                  this.$Message.success('成功');
                  this.query()
                  this.buttonLoading = false
                  this.energyVisible = false
                } else {
                  this.$Message.error('请求失败');
                }
              }).catch(e => {
                this.$Message.error('请求失败');
              })
            }
          }
        }
      })
    },
    pageSizeChange(pageSize) {
      this.pagedata.pageSize = pageSize;
      this.query();
    },
    pageChange(pageNum) {
      this.pagedata.currentPage = pageNum;
      this.query();
    },
    reset() {
      this.queryParam = {projectName: "", dutyOrgName: '', projectLevel: '', projectNature: ''}
      this.query();
    },
    onCancel() {
      this.environmentalVisible = false;
      this.healthVisible = false;
      this.safeVisible = false;
      this.energyVisible = false;
    },
    switchQuery(flag) {
      this.switchFlag = flag;
      if (!this.switchFlag) {
        this.tableHeight = this.tableHeight + 44;
      } else {
        this.tableHeight = this.tableHeight - 44;
      }
    },
    queryEnvironmentalProcess() {
      this.environmentalProcessFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=environmental_Process").then(function (res) {
        res.data.data.forEach(item => {
          this.environmentalProcessFiles.push(item);
        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    queryHealthProcess() {
      this.healthProcessFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=health_Process").then(function (res) {
        res.data.data.forEach(item => {
          this.healthProcessFiles.push(item);
        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    querySafeProcess() {
      this.safeProcessFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=safe_Process").then(function (res) {
        res.data.data.forEach(item => {
          this.safeProcessFiles.push(item);
        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    queryEnergyProcess() {
      this.energyProcessFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=energy_Process").then(function (res) {
        res.data.data.forEach(item => {
          this.energyProcessFiles.push(item);
        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    queryFireProcess() {
      this.fireProcessFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=fire_Process").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "report") {
            this.fireProcessFiles.push(item);
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    queryEnvironmental() {
      this.environmentalDesignFile = {};
      this.environmentalInfluenceReportFile = {},
          this.environmentalInfluenceReplyFile = {},
          this.environmentalSoilWaterReportFile = {},
          this.environmentalSoilWaterPayProofFile = {},
          this.environmentalSoilWaterGovermentReplyFile = {},
          this.environmentalSoilWaterReplyFile = {},
          this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=environmental").then(function (res) {
            res.data.data.forEach(item => {
              if (item.field == "report") {
                this.environmentalDesignFile = item;
              }
              if (item.field == "influenceReport") {
                this.environmentalInfluenceReportFile = item;
              }
              if (item.field == "influenceReply") {
                this.environmentalInfluenceReplyFile = item;
              }
              if (item.field == "soilWaterReport") {
                this.environmentalSoilWaterReportFile = item;
              }
              if (item.field == "soilWaterPayProof") {
                this.environmentalSoilWaterPayProofFile = item;
              }
              if (item.field == "soilWaterGovermentReply") {
                this.environmentalSoilWaterGovermentReplyFile = item;
              }
              if (item.field == "soilWaterReply") {
                this.environmentalSoilWaterReplyFile = item;
              }
            })
          }, function (res) {
            this.$Message.error('请求失败');
            this.loading = false;
          });
      this.$http.get(Api.getEnvironmentalsByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.isUpdate = false;
          this.threeSimEnvironmentalDatas = [{
            projectId: this.selectedInfo.projectId,
            createUserId: this.currentUser.userId,
            createOrgId: this.currentUser.orgInfo.orgId,
            createDate: new Date(),
            createDateStr: this.formatDate(new Date()),
            bsflag: '0',
            environmentType: '0',
            environmentTypeName: '环境影响评价',
            remark: ''
          },
            {
              projectId: this.selectedInfo.projectId,
              createUserId: this.currentUser.userId,
              createOrgId: this.currentUser.orgInfo.orgId,
              createDate: new Date(),
              createDateStr: this.formatDate(new Date()),
              bsflag: '0',
              environmentType: '1',
              environmentTypeName: '环保竣工验收',
              remark: ''
            },
            {
              projectId: this.selectedInfo.projectId,
              createUserId: this.currentUser.userId,
              createOrgId: this.currentUser.orgInfo.orgId,
              createDate: new Date(),
              createDateStr: this.formatDate(new Date()),
              bsflag: '0',
              environmentType: '2',
              environmentTypeName: '水土保持评价',
              remark: ''
            },
            {
              projectId: this.selectedInfo.projectId,
              createUserId: this.currentUser.userId,
              createOrgId: this.currentUser.orgInfo.orgId,
              createDate: new Date(),
              createDateStr: this.formatDate(new Date()),
              bsflag: '0',
              environmentType: '3',
              environmentTypeName: '水土保持验收',
              remark: ''
            },
          ]
        } else {
          this.threeSimEnvironmentalDatas = res.data.data;
          this.threeSimEnvironmentalDatas.forEach(item => {
            if (item.environmentType == "0") {
              item.environmentTypeName = "环境影响评价"
            }
            if (item.environmentType == "1")
              item.environmentTypeName = "环保竣工验收"
            if (item.environmentType == "2")
              item.environmentTypeName = "水土保持评价"
            if (item.environmentType == "3")
              item.environmentTypeName = "水土保持验收"
          })
        }
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
    },
    queryHealth() {
      this.healthBuildUnitFile = {};
      this.healthEvaluateProjectFile = {};
      this.healthBuildUnitAdviceFile = {};
      this.healthEvaluateReportFile = {};
      this.healthModifySureFile = {};
      this.healthPreEvaluateProjectFile = {};
      this.healthProtectDesignFile = {};
      this.healthReportModifyFile = {};
      this.healthZJAcceptAdviceFile = {"name": ""};
      this.healthZJAdviceFile = {"name": ""};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=health").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "buildUnit") {
            this.healthBuildUnitFile = item;
          }
          if (item.field == "evaluateProject") {
            this.healthEvaluateProjectFile = item;
          }
          if (item.field == "buildUnitAdvice") {
            this.healthBuildUnitAdviceFile = item;
          }
          if (item.field == "evaluateReport") {
            this.healthEvaluateReportFile = item;
          }
          if (item.field == "modifySure") {
            this.healthModifySureFile = item;
          }
          if (item.field == "preEvaluateProject") {
            this.healthPreEvaluateProjectFile = item;
          }
          if (item.field == "protectDesign") {
            this.healthProtectDesignFile = item;
          }
          if (item.field == "reportModify") {
            this.healthReportModifyFile = item;
          }
          if (item.field == "zjAcceptAdvice") {
            this.healthZJAcceptAdviceFile = item;
          }
          if (item.field == "zjAdvice") {
            this.healthZJAdviceFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getHealthByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.isUpdate = false;
          this.threeSimHealthData = {}
          this.healthVisible = true;
          this.titleName = "新增";
        } else {
          this.isUpdate = true;
          this.threeSimHealthData = res.data.data[0];
          this.healthVisible = true;
          this.titleName = "修改";
        }
      });
    },
    querySafe() {
      this.safeDesignReplyFile = {};
      this.safeDesignReportFile = {};
      this.safePreEvaluateAdviceFile = {};
      this.safePreEvaluateReportFile = {};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=safe").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "designReply") {
            this.safeDesignReplyFile = item;
          }
          if (item.field == "designReport") {
            this.safeDesignReportFile = item;
          }
          if (item.field == "preEvaluateAdvice") {
            this.safePreEvaluateAdviceFile = item;
          }
          if (item.field == "preEvaluateReport") {
            this.safePreEvaluateReportFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getSafeByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.isUpdate = false;
          this.threeSimSafeData = {}
        } else {
          this.isUpdate = true;
          this.threeSimSafeData = res.data.data[0];
        }
      });
    },
    queryEnergy() {
      this.energyControlDetailFile = {};
      this.energyLocalGovermentReplyFile = {};
      this.energyReportFile = {};
      this.energyLocalGovermentReportFile = {};
      this.energySummaryFile = {};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=energy").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "controlDetail") {
            this.energyControlDetailFile = item;
          }
          if (item.field == "localGovermentReply") {
            this.energyLocalGovermentReplyFile = item;
          }
          if (item.field == "report") {
            this.energyReportFile = item;
          }
          if (item.field == "localGovermentReport") {
            this.energyLocalGovermentReportFile = item;
          }
          if (item.field == "summary") {
            this.energySummaryFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getEnergyByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.isUpdate = false;
          this.threeSimEnergyData = {}
        } else {
          this.isUpdate = true;
          this.threeSimEnergyData = res.data.data[0];
        }
      });
    },
    queryEnvironmentalComplete() {
      this.environReceiveFile = {"name": ""};
      this.environWaterSoilDetectionFile = {"name": ""};
      this.environReceiveRecordFile = {"name": ""};
      this.environWaterSoilManageFile = {"name": ""};
      this.environWaterSoilReceiveFile = {"name": ""};
      this.environWaterSoilReceiveReplyFile = {"name": ""};
      this.environDetectionFile = {"name": ""};
      this.environManageReportFile = {"name": ""};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=environmental_complete").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "manageReport") {
            this.environManageReportFile = item;
          }
          if (item.field == "detection") {
            this.environDetectionFile = item;
          }
          if (item.field == "waterSoilReceiveReply") {
            this.environWaterSoilReceiveReplyFile = item;
          }
          if (item.field == "waterSoilReceive") {
            this.environWaterSoilReceiveFile = item;
          }
          if (item.field == "waterSoilManage") {
            this.environWaterSoilManageFile = item;
          }
          if (item.field == "waterSoilDetection") {
            this.environWaterSoilDetectionFile = item;
          }
          if (item.field == "receiveRecord") {
            this.environReceiveRecordFile = item;
          }
          if (item.field == "receive") {
            this.environReceiveFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getEnvironmentalCompleteByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.isUpdate = false;
          this.threeSimEnvironmentalCompleteData = {
            projectId: this.selectedInfo.projectId,
            createUserId: this.currentUser.userId,
            createOrgId: this.currentUser.orgInfo.orgId,
            createDate: new Date(),
            createDateStr: this.formatDate(new Date()),
            bsflag: '0'
          }
        } else {
          this.threeSimEnvironmentalCompleteData = res.data.data[0];
          this.isUpdate = true;
        }
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
    },
    queryHealthComplete() {
      this.healthBuildUnitAdviceFile = {"name": ""};
      this.healthControlEvaluateFile = {"name": ""};
      this.healthMaterialFile = {"name": ""};
      this.healthReceiveReportFile = {"name": ""};
      this.healthReceiveWorkFile = {"name": ""};
      this.healthReportModifyAndReceiveFile = {"name": ""};
      this.healthZJGroupFile = {"name": ""};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=health_complete").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "buildUnitAdvice") {
            this.healthBuildUnitAdviceFile = item;
          }
          if (item.field == "controlEvaluate") {
            this.healthControlEvaluateFile = item;
          }
          if (item.field == "material") {
            this.healthMaterialFile = item;
          }
          if (item.field == "receiveReport") {
            this.healthReceiveReportFile = item;
          }
          if (item.field == "receiveWork") {
            this.healthReceiveWorkFile = item;
          }
          if (item.field == "reportModifyAndReceive") {
            this.healthReportModifyAndReceiveFile = item;
          }
          if (item.field == "zjGroup") {
            this.healthZJGroupFile = item;
          }

        })
      }, function (res) {
        this.$Message.error('请求失败');
      });
    },
    querySafeComplete() {
      this.safeFacilityReceiveAdviceFile = {"name": ""};
      this.safeFacilityReplyFile = {"name": ""};
      this.safeReceiveEvaluateAdviceFile = {"name": ""};
      this.safeReceiveEvaluateReportFile = {"name": ""};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=safe_complete").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "facilityReceiveAdvice") {
            this.safeFacilityReceiveAdviceFile = item;
          }
          if (item.field == "facilityReply") {
            this.safeFacilityReplyFile = item;
          }
          if (item.field == "receiveEvaluateAdvice") {
            this.safeReceiveEvaluateAdviceFile = item;
          }
          if (item.field == "receiveEvaluateReport") {
            this.safeReceiveEvaluateReportFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getSafeCompleteByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.threeSimSafeCompleteData = {}
        } else {
          this.threeSimSafeCompleteData = res.data.data[0];
        }
      });
    },
    queryEnergyComplete() {
      this.energyLocalGovermentReceiveAdviceFile = {"name": ""};
      this.energyReceiveReportFile = {"name": ""};
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=energy_complete").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "localGovermentReceiveAdvice") {
            this.energyLocalGovermentReceiveAdviceFile = item;
          }
          if (item.field == "receiveReport") {
            this.energyReceiveReportFile = item;
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
      this.$http.get(Api.getEnergyCompleteByProjectId + "/" + this.selectedInfo.projectId).then(function (res) {
        if (res.data.data.length == 0) {
          this.threeSimEnergyCompleteData = {}
        } else {
          this.threeSimEnergyCompleteData = res.data.data[0];
        }
      });
    },
    queryFire() {
      this.fireReportFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=fire").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "report") {
            this.fireReportFiles.push(item);
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
    },
    queryFireComplete() {
      this.fireCompleteReportFiles = [];
      this.$http.get(Api.morePicture + '/' + this.selectedInfo.projectId + "?type=fire_complete").then(function (res) {
        res.data.data.forEach(item => {
          if (item.field == "report") {
            this.fireCompleteReportFiles.push(item);
          }
        })
      }, function (res) {
        this.$Message.error('请求失败');
        this.loading = false;
      });
    },
    updateInfo(row) {
      this.isUpdate = true;
      this.form1 = row;
      this.form1.projectType = [];
      if (this.form1.isEnergy = '1')
        this.form1.projectType.push('4')
      if (this.form1.isEnvironmental = '1')
        this.form1.projectType.push('1')
      if (this.form1.isHealth = '1')
        this.form1.projectType.push('2')
      if (this.form1.isSafe = '1')
        this.form1.projectType.push('3')
      this.form1.updateOrgId = this.currentUser.orgInfo.orgId,
          this.form1.updateUserId = this.currentUser.userId;
      this.form1.updateDate = new Date(),
          this.titleName = "修改";
      this.modal1 = true;
    },
    viewInfo(row) {
      this.tabName = "name1";
      this.selectedInfo = row;
      this.showdata = row;
      this.showdata.projectType = [];
      if (this.showdata.isEnergy == '1')
        this.showdata.projectType.push('4')
      if (this.showdata.isEnvironmental == '1')
        this.showdata.projectType.push('1')
      if (this.showdata.isHealth == '1')
        this.showdata.projectType.push('2')
      if (this.showdata.isSafe == '1')
        this.showdata.projectType.push('3')
      if (this.showdata.isFire == '1')
        this.showdata.projectType.push('5')
      this.showdata.establishmentTimeStr = this.formatDate(new Date(this.showdata.establishmentTime), "yyyy-MM-dd");
      this.showdata.startTimeStr = this.formatDate(new Date(this.showdata.startTime), "yyyy-MM-dd");
      this.showdata.endTimeStr = this.formatDate(new Date(this.showdata.endTime), "yyyy-MM-dd");
      if (this.projectNatureMaps && this.showdata.projectNature) {
        this.showdata.projectNatureName = this.projectNatureMaps[this.showdata.projectNature].codingName;
      }
      if (this.projectLevelMaps && this.showdata.projectLevel) {
        this.showdata.projectLevelName = this.projectLevelMaps[this.showdata.projectLevel].codingName;
      }
      this.titleName = "详情";
      this.threeSimAccountVisible = true;
      this.queryEnergy();
      this.queryHealth();
      this.queryEnergyProcess();
      this.queryEnvironmentalProcess();
      this.querySafeProcess();
      this.queryHealthProcess();
      this.queryFireProcess();
      this.queryEnvironmental();
      this.querySafe();
      this.queryEnergyComplete();
      this.queryHealthComplete();
      this.queryEnvironmentalComplete();
      this.querySafeComplete();
      this.queryFire();
      this.queryFireComplete();
    },
    setOrgId(data) {
      this.dataToQuery.orgId = data[data.length - 1];
    },
    setOrgName(data) {
      this.dataToQuery.orgName = data;
    },
    uploadFile(file, type, field) {
      let formData = new FormData();
      formData.append("file", file); // 文件对象
      formData.append("type", type);
      formData.append("field", field);
      let url = Api.singlePicture + '/' + this.selectedInfo.projectId;
      this.$http.post(url, formData).then((res) => {
        if (res.data.result == "success") {
          this.$Message.info("文件上传成功")
        }
      });
    },
    uploadEnvironmentalDesignFile(file) {
      this.environmentalDesignFile = file;
      this.environmentalDesignFile.fileName = file.name;
      this.uploadFile(file, "environmental", "report")
      return false;
    },
    uploadEnvironmentalInfluenceReportFile(file) {
      this.environmentalInfluenceReportFile = file;
      this.uploadFile(file, "environmental", "influenceReport")
      return false;
    },
    uploadEnvironmentalInfluenceReplyFile(file) {
      this.environmentalInfluenceReplyFile = file;
      this.uploadFile(file, "environmental", "influenceReply")
      return false;
    },
    uploadEnvironmentalSoilWaterGovermentReplyFile(file) {
      this.environmentalInfluenceReportFile = file;
      this.uploadFile(file, "environmental", "soilWaterGovermentReply")
      return false;
    },
    uploadEnvironmentalSoilWaterReplyFile(file) {
      this.environmentalSoilWaterReplyFile = file;
      this.uploadFile(file, "environmental", "soilWaterReply")
      return false;
    },
    uploadEnvironmentalSoilWaterReportFile(file) {
      this.environmentalSoilWaterReportFile = file;
      this.uploadFile(file, "environmental", "soilWaterReport")
      return false;
    },
    uploadEnvironmentalSoilWaterPayProofFile(file) {
      this.environmentalSoilWaterPayProofFile = file;
      this.uploadFile(file, "environmental", "soilWaterPayProof")
      return false;
    },
    uploadHealthBuildUnitAdviceFile(file) {
      this.healthBuildUnitAdviceFile = file;
      this.uploadFile(file, "health", "buildUnitAdvice")
      return false;
    },
    uploadHealthBuildUnitFile(file) {
      this.healthBuildUnitFile = file;
      this.uploadFile(file, "health", "buildUnit")
      return false;
    },
    uploadHealthEvaluateProjectFile(file) {
      this.healthEvaluateProjectFile = file;
      this.uploadFile(file, "health", "evaluateProject")
      return false;
    },
    uploadHealthPreEvaluateProjectFile(file) {
      this.healthPreEvaluateProjectFile = file;
      this.uploadFile(file, "health", "preEvaluateProject")
      return false;
    },
    uploadHealthEvaluateReportFile(file) {
      this.healthEvaluateReportFile = file;
      this.uploadFile(file, "health", "evaluateReport")
      return false;
    },
    uploadHealthModifySureFile(file) {
      this.healthModifySureFile = file;
      this.uploadFile(file, "health", "modifySure")
      return false;
    },
    uploadHealthProtectDesignFile(file) {
      this.healthProtectDesignFile = file;
      this.uploadFile(file, "health", "protectDesign")
      return false;
    },
    uploadHealthReportModifyFile(file) {
      this.healthReportModifyFile = file;
      this.uploadFile(file, "health", "reportModify")
      return false;
    },
    uploadHealthZJAcceptAdviceFile(file) {
      this.healthZJAcceptAdviceFile = file;
      this.uploadFile(file, "health", "zjAcceptAdvice")
      return false;
    },
    uploadHealthZJAdviceFile(file) {
      this.healthZJAdviceFile = file;
      this.uploadFile(file, "health", "zjAdvice")
      return false;
    },
    uploadSafeDesignReplyFile(file) {
      this.safeDesignReplyFile = file;
      this.uploadFile(file, "safe", "designReply")
      return false;
    },
    uploadSafeDesignReportFile(file) {
      this.safeDesignReportFile = file;
      this.uploadFile(file, "safe", "designReport")
      return false;
    },
    uploadSafePreEvaluateReportFile(file) {
      this.safePreEvaluateReportFile = file;
      this.uploadFile(file, "safe", "preEvaluateReport")
      return false;
    },
    uploadSafePreEvaluateAdviceFile(file) {
      this.safePreEvaluateAdviceFile = file;
      this.uploadFile(file, "safe", "preEvaluateAdvice")
      return false;
    },
    uploadEnergyControlDetailFile(file) {
      this.energyControlDetailFile = file;
      this.uploadFile(file, "energy", "controlDetail")
      return false;
    },
    uploadEnergyLocalGovermentReplyFile(file) {
      this.energyLocalGovermentReplyFile = file;
      this.uploadFile(file, "energy", "localGovermentReply")
      return false;
    },
    uploadEnergyLocalGovermentReportFile(file) {
      this.energyLocalGovermentReportFile = file;
      this.uploadFile(file, "energy", "localGovermentReport")
      return false;
    },
    uploadEnergyReportFile(file) {
      this.energyReportFile = file;
      this.uploadFile(file, "energy", "report")
      return false;
    },
    uploadEnergySummaryFile(file) {
      this.energySummaryFile = file;
      this.uploadFile(file, "energy", "summary")
      return false;
    },
    deleteInfo(row) {
      this.$Modal.confirm({
        title: '数据删除',
        content: '<p>确定删除该条信息</p>',
        okText: '确认',
        onOk: () => {
          this.$http.delete(Api.threeSimProject + "/" + row.projectId, {
            params: {
              updateUserId: this.currentUser.userId
            }
          }).then((res) => {
            this.$Message.success({content: '删除成功', duration: 4});
            this.query();
          })
        },
        cancelText: '取消'
      });
    },
    queryProjectNatureList() {
      this.$http.get(Api.projectNatureMaps).then((res) => {
        if (res.data.status == 200) {
          this.projectNatureMaps = res.data.data;
        }
      }).catch(e => {
        this.$Message.error("附件删除失败");
      });
    },
    queryProjectLevelList() {
      this.$http.get(Api.projectLevelMaps).then((res) => {
        if (res.data.status == 200) {
          this.projectLevelMaps = res.data.data;
        }
      }).catch(e => {
        this.$Message.error("附件删除失败");
      });
    },
    formatDate(date, fmt) {
      if (typeof date == 'string') {
        return date;
      }
      if (!fmt) fmt = "yyyy-MM-dd hh:mm:ss";
      if (!date || date == null) return null;
      let o = {
        'M+': date.getMonth() + 1, // 月份
        'd+': date.getDate(), // 日
        'h+': date.getHours(), // 小时
        'm+': date.getMinutes(), // 分
        's+': date.getSeconds(), // 秒
        'q+': Math.floor((date.getMonth() + 3) / 3), // 季度
        'S': date.getMilliseconds() // 毫秒
      }
      if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
      for (let k in o) {
        if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
      }
      return fmt
    },
    uuid() {
      let s = [];
      let hexDigits = "0123456789abcdef";
      for (let i = 0; i < 32; i++) {
        s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
      }
      s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
      s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
      let uuid = s.join("");
      return uuid
    },
  }
}
</script>
